package cn.wolfcode.ssm.enums;

import lombok.Getter;

@Getter
public enum AppointmentStatusEnum {
    PEND("待确认",0),
    PERFORM("履行中",1),
    CONSUME("消费中",2),
    FINISH("归档",3),
    FAILURE("废弃",4);

    private String name;
    private Integer value;

    AppointmentStatusEnum(String name,Integer value) {
        this.name  = name;
        this.value = value;
    }

    public static String findEnumNameByValue(Integer value){
        AppointmentStatusEnum[] values = AppointmentStatusEnum.values();
        for (AppointmentStatusEnum anEnum : values) {
            if (anEnum.value==value) {
                return anEnum.name;
            }
        }
        return null;
    }

    @Getter
    public enum BusinessReportGroupTypeEnum {
        BUSINESS_NAME("门店名","b.name"),
        YERA("年","DATE_FORMAT(c.create_time,'%Y')"),
        MONTH("月","DATE_FORMAT(c.create_time,'%Y-%m')"),
        DAY("日","DATE_FORMAT(c.create_time,'%Y-%m-%d')");

        private String name;
        private String value;

        BusinessReportGroupTypeEnum(String name, String value) {
            this.name = name;
            this.value = value;
        }

        public static String findEnumNameByValue(String value){
            BusinessReportGroupTypeEnum[] values = BusinessReportGroupTypeEnum.values();
            for (BusinessReportGroupTypeEnum anEnum : values) {
                if (anEnum.value.equals(value)) {
                    return anEnum.name;
                }
            }
            return null;
        }
    }
}
